#!/usr/bin/env python
#Delete all tags and removing 
#spaces from HTML files
#Yijie, Li (340385)

import re
from urllib import urlopen


f = urlopen("http://www.google.com")
#use 'f=open' if using local file
#f =open('google.htm') 
raw = f.read()


#Removing all the HTML tags from the file
raw = re.sub(r'<.*?>','',raw)

f=open('test.txt','w')
f.write (raw)
f.close()

#Removing all space lines from new file
empty=re.compile('^$')
for line in open('test.txt').readlines():
    if empty.match(line):
        continue
    else:
        print line,





